package com.miage.itrading.gui;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.ImageIcon;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.KeyStroke;

public class Menu extends JMenuBar{

	private static final long serialVersionUID = 2277308043630042541L;


	public Menu(){
		super();
		JMenu menuFichier = new JMenu();
		menuFichier.setText("Fichier");


		JMenuItem mi1 = new JMenuItem();
		mi1.setText("Quitter");
		mi1.setIcon(new ImageIcon("res/Images/sortie.png"));
		java.awt.event.ActionListener action = new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent e) {
				System.exit(0);
			}
		};
		mi1.setMnemonic(KeyEvent.VK_Q);
		mi1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.ALT_MASK));
		mi1.setActionCommand("quit");
		mi1.addActionListener(action);
		mi1.setEnabled(true);
		menuFichier.add(mi1);

		this.add(menuFichier);

	}
}
